home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
CHASSIS_
/
CURSORSE.C
< prev
next >
Wrap
Text File
|
1992-05-14
|
2KB
|
69 lines
/************************************************************************************/
/* CursorSelect */
/* */
/* Controls the choice of cursor. Executed from main event loop with theWindow, */
/* and partNo, or from anywhere else with just the cursorNo. If all three are */
/* NIL, initialize the cursor to the startup arrow. */
/* */
/************************************************************************************/
#include "MyHeaders.h"
int CursorSelect(WindowPtr theWindow, int partNo, int cursorNo)
{
int CSRetCode = 0; /* set return code */
CursHandle theCursor; /* handle to cursor */
TEHandle myTEdHandle; /* work handle */
if (theWindow) /* if in a window */
{
WorkRetCode = WhichWindow(theWindow, &windSub); /* find which window */
switch (windTbl[windSub].windRec.refCon) /* switch by wind type */
{
case (ProcMain): /* if main window */
InitCursor(); /* set arrow cursor */
break;
case (ProcText): /* if text window */
switch (partNo) /* where in window? */
{
case (inContent): /* if in content region */
if (PtInRect(locMouse, /* TE view? */
&(**windTbl[windSub].windTEH[0]).viewRect))
{ /* get I-beam */
theCursor = GetCursor(iBeamCursor);
SetCursor (&(**theCursor)); /* set it */
}
else /* elsewhere in content */
InitCursor(); /* set arrow */
break;
default: /* not in content */
InitCursor(); /* set arrow */
break;
}
break; /* end of text window */
case (ProcHelp): /* if Help window */
InitCursor(); /* set arrow cursor */
break;
}
}
else /* else if not in a wdo */
if (partNo) /* if known part number */
InitCursor(); /* set arrow */
else
if (cursorNo) /* else if specific csr */
{
theCursor = GetCursor(cursorNo); /* get specific cursor */
SetCursor (&(**theCursor)); /* set it */
}
else /* if all NIL's */
InitCursor(); /* set arrow */
return CSRetCode; /* return */
}